import importlib
from global_fuction import  config_get


# 主程序开始
def main():

    PIPELINESITEM = config_get('pipelines','PIPELINESITEM')

    #反射调用
    class_full_name = "MyClassXXX.MyClass"

    last_index_rfind = class_full_name.rfind('.')
    class_name_length = len(class_full_name)

    namespace_name = class_full_name[:last_index_rfind]
    class_name = class_full_name[last_index_rfind + 1:class_name_length]


    module = importlib.import_module(namespace_name)
    class_obj = getattr(module, class_name,None) # 不存在则为None

    class_obj_dict = {}
    class_obj_dict[class_full_name] = class_obj

    if class_obj  != None:
        class_obj.process_item(class_obj,2)

    #遍历插件
    for key, value in class_obj_dict.items():

        if class_obj != None:
            class_obj = class_obj_dict[key]
            class_obj.process_item(class_obj,34)

# 调用主函数
if __name__ == "__main__":
    main()